Configuring OVOC as the Email Server on Microsoft Azure using SMTP Relay
This procedure describes how to configure the OVOC server to forward alarms by email using SMTP Relay. This setup is recommended by Microsoft, and SendGrid is one of the available options. SendGrid service can be easily configured in the Azure Portal and in addition, includes a free tier subscription, supporting up to 25,000 emails per month.
|
1.
|
Create SendGrid service on the Azure platform: |
|
b.
|
Go to "SendGrid Accounts" section, ( via Search or in "All services" section). |
|
d.
|
Fill in the following fields: |
Name: Choose a name
Password
Subscription
Resource Group (create a new one or choose existing)
Pricing tier: choose Free or one of the other plans
Contact Information
Read legal terms
|
f.
|
Wait for the service to be created. |
|
g.
|
Go back to "SendGrid Accounts", click on the new account name |
|
h.
|
Click the"Configurations" section in the Settings tab. |
|
i.
|
Copy the Username – it will be used in the next step along with the password (format azure_xxxxxxxx@azure.com) |
|
2.
|
Configure the Exim service on the OVOC server: |
|
a.
|
Login into the OVOC server by SSH, as ‘acems’ user and enter password acems. |
|
b.
|
Switch to 'root' user and provide root password (default password is root): |
su - root
|
c.
|
Backup the exim configuration file: |
cp /etc/exim/exim.conf /etc/exim/exim.conf.bak
|
d.
|
Edit the exim configuration file: |
vim /etc/exim/exim.conf
|
e.
|
After the line "begin transports", add the following configuration: |
begin transports
sendgrid_smtp:
driver = smtp
hosts = smtp.sendgrid.net
hosts_require_auth = <; $host_address
hosts_require_tls = <; $host_address
|
f.
|
After the line "begin routers", add the following configuration: |
begin routers
send_via_sendgrid:
driver = manualroute
domains = ! +local_domains
transport = sendgrid_smtp
route_list = "* smtp.sendgrid.net::587 byname"
host_find_failed = defer
no_more
|
g.
|
After the line "begin authenticators", add the following configuration, replacing Username and Password with your SendGrid User/Pass: |
begin authenticators
sendgrid_login:
driver = plaintext
public_name = LOGIN
client_send = : Username : Password
|
h.
|
Save the file and exit back to the command line. |
|
i.
|
Restart the Exim service. |
systemctl restart exim
|
j.
|
Check that the alarm forwarding by email functions correctly. |
You can access the SendGrid Web interface using the same username/password, where among other features you can find an Activity log, which may be useful for verifying issues such as when emails are sent correctly; however, are blocked by a destination email server.